// reducer

import { SET_TOKEN } from '@/store/actionType'
import { getToken } from '@/utils/storage'
const initState = {
  token: getToken() || ''

}
function login (state = initState, action) {
  console.log(action)
  if (action.type === SET_TOKEN) {
    return { ...state, token: action.payload }
  }
  return state
}

export default login
